﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using SelfService.Model.Models;
using SelfService.Model;


namespace SelfService.ViewModel.SysDeviceVMs
{
    public partial class SysDeviceTemplateVM : BaseTemplateVM
    {
        [Display(Name = "名称")]
        public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.Name);
        [Display(Name = "型号")]
        public ExcelPropety Model_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.Model);
        [Display(Name = "描述")]
        public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.Description);
        [Display(Name = "通讯方式")]
        public ExcelPropety Mode_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.Mode);
        [Display(Name = "硬件类型")]
        public ExcelPropety Group_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.GroupId);
        [Display(Name = "端口")]
        public ExcelPropety Port_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.Port);
        [Display(Name = "Dll文件名称")]
        public ExcelPropety DllName_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.DllName);
        [Display(Name = "DLL类名称")]
        public ExcelPropety DllClass_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.DllClass);
        [Display(Name = "DLL命名空间")]
        public ExcelPropety DllWorkSpace_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.DllWorkSpace);
        [Display(Name = "是否启用")]
        public ExcelPropety IsEnable_Excel = ExcelPropety.CreateProperty<SysDevice>(x => x.IsEnable);

	    protected override void InitVM()
        {
            Group_Excel.DataType = ColumnDataType.ComboBox;
            Group_Excel.ListItems = DC.Set<SysDeviceGroup>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysDeviceImportVM : BaseImportVM<SysDeviceTemplateVM, SysDevice>
    {

    }

}
